import request from '@/utils/request'

// 获取路由
export const getRouters = () => {
    return request({
        url: '/system/block/menu/getRouters',
        method: 'get'
    })
}

// 查询菜单列表
export function getMenuList(query) {
    return request({
        url: '/system/block/menu/list',
        method: 'get',
        params: query
    })
}
// 获取菜单树
export const getMenuTree = () => {
    return request({
        url: '/system/block/menu/getMenuTree',
        method: 'get'
    })
}
// 新增菜单信息
export function addMenu(data) {
    return request({
        url: '/system/block/menu/addMenu',
        method: 'post',
        data: data
    })
}
// 编辑菜单信息
export function editMenu(data) {
    return request({
        url: '/system/block/menu/editMenu',
        method: 'put',
        data: data
    })
}
// 编辑菜单状态
export function editMenuStatus(data) {
    return request({
        url: '/system/block/menu/editMenuStatus',
        method: 'put',
        data: data
    })
}

// 删除菜单信息
export function deleteMenu(menuId) {
    return request({
        url: '/system/block/menu/deleteMenu/' + menuId,
        method: 'delete'
    })
}
